package greedy;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

/**
 * @author : Rookie
 * @description : 最长连续上升子序列
 * @date : 2023/6/30
 */
public class MaxContinuousUpSubSequence {

    public static void main(String[] args) {
        int[] sequence = new int[]{1,3,5,4,7};
        List<List<Integer>> result = new ArrayList<>();
        List<Integer> temp = new ArrayList<>();
        temp.add(sequence[0]);
        for (int i = 1; i < sequence.length; i++) {
            if (sequence[i] > sequence[i - 1]) {
                temp.add(sequence[i]);
            } else {
                result.add(new ArrayList<>(temp));
                temp.clear();
            }
        }
        result.stream().max(Comparator.comparingInt(List::size)).ifPresent(System.out::println);
    }
}
